/*
 * @Author: 徐伟杰/Hyuishine
 * @Date: 2022/5/19
 * @LastEditors: 徐伟杰
 * @LastEditTime: 2022-12-12 14:08:37
 * @Description:
 * @Email: 1529315455@qq.com
 * @Company: 3xData
 * @youWant: add you want
 */

import {
  getExposureListApi,
  getReviewedListApi,
  getNoReviewedListApi,
  getContentManageListApi,
  getContentManageByIdApi,
  getAgencyInfoByIdApi,
  getMeetRequireMent,
  checkOperationStatus,
  getSubmit,
} from "@/api/home.js";

const home = {
  state: {
    auditState: null, // 工作台

    networkType: false, // 判断当前网络状态
  },
  mutations: {
    saveAuditState(state, data) {
      state.auditState = data;
    },

    SETNETWORKTYPE(state, data) {
      console.log("SETNETWORKTYPE", data)
      state.networkType = data;
    },
  },
  actions: {
    // 获取曝光台列表数据
    getExposureList(context, obj) {
      return new Promise((resolve, reject) => {
        getExposureListApi(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取工作台机构信息是否需要提交
    getSubmitApi(context, obj) {
      return new Promise((resolve, reject) => {
        getSubmit(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取技术服务机构已审核列表数据
    getReviewedList(context, obj) {
      return new Promise((resolve, reject) => {
        getReviewedListApi(obj, function (data) {
          resolve(data);
        });
      });
    },
    // 获取技术服务机构未审核列表数据
    getNoReviewedList(context, obj) {
      return new Promise((resolve, reject) => {
        getNoReviewedListApi(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取通知公告列表数据
    getContentManageList(context, obj) {
      return new Promise((resolve, reject) => {
        getContentManageListApi(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取通知公告详情列表数据
    getContentManageById(context, obj) {
      return new Promise((resolve, reject) => {
        getContentManageByIdApi(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取机构信息列表的详情数据
    getAgencyInfoById(context, obj) {
      return new Promise((resolve, reject) => {
        getAgencyInfoByIdApi(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取当前角色所属的机构是否满足执业要求
    getMeetRequireMentApi(context, obj) {
      return new Promise((resolve, reject) => {
        getMeetRequireMent(obj, function (data) {
          resolve(data);
        });
      });
    },

    // 获取当前角色所属的机构是否满足执业要求
    checkOperationStatusApi(context, obj) {
      return new Promise((resolve, reject) => {
        checkOperationStatus(obj, function (data) {
          resolve(data);
        });
      });
    },
  },
};

export default home;
